package cn.stylefeng.guns.modular.xs2.web;


import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.stylefeng.guns.modular.xs2.entity.Student;
import cn.stylefeng.guns.modular.xs2.service.IStudentService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author kzwang
 * @since 2020-06-17
 */
@RestController
@RequestMapping("/xs2/student")
public class StudentAction {
	
	@Autowired
	private IStudentService studentService;

	@RequestMapping("save")
	public Student save() {
		Student stu = new Student();
		stu.setName("王五");
		stu.setSex("女");
		stu.setBirthday(new Date());
		studentService.save(stu);
		
		return stu;
	}
	
	@RequestMapping("list")
	public List<Student> list() {
		return studentService.list();
	}
	
}
